import Vue from 'vue'
import VueRouter from 'vue-router'
import Ebook from '../views/ebook/index.vue'
import ebookRender from '../components/Ebook/ebookRender'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/store'
  },
  {
    path: '/ebook',
    component: Ebook,
    children: [{
      path: ':fileName',
      component: ebookRender
    }]
  },
  {
    path:"/store",
    component:()=>import('../views/store/index.vue'),
    redirect:'/store/home',
    children:[
      {
      path:'home',
      component:()=>import('../views/store/StoreHome.vue')
    },
      {
        path:'list',
        component:()=>import('../views/store/StoreList.vue')
      },
      {
        path:'detail',
        component:()=>import('../views/store/StoreDetail.vue')
      }
  ]
  }

]

const router = new VueRouter({
  routes
})

export default router
